home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 224_01 / tr.hlp < prev    next >
Text File  |  1987-01-04  |  2KB  |  39 lines

  1. NAME
  2.      tr - translate characters
  3.  
  4. SYNTAX
  5.      tr [ -cds ] string1 [ string2 ]
  6.  
  7. DESCRIPTION
  8.     Tr copies the standard input to the standard output with substitution or 
  9.     deletion of selected characters.  Input characters found in string1 are 
  10.     mapped into the corresponding characters of string2.  When string2 is short
  11.     it is padded to the length of string1 by duplicating its last character.  
  12.     
  13.     Any combination of the options -cds may be used: 
  14.     
  15.     -c  complements the set of characters in string1 with respect to the 
  16.     universe of characters whose ASCII codes are 01 through 0377 octal
  17.     
  18.     -d  deletes all input characters in string1
  19.     
  20.     -s  squeezes all strings of repeated output characters that are in 
  21.     string2 to single characters.
  22.  
  23.     In either string the notation a-b means a range of characters from a to b 
  24.     in increasing ASCII order.  The character '\' followed by 1, 2 or 3 octal 
  25.     digits stands for the character whose ASCII code is given by those digits.
  26.     A '\' followed by b, n, r, f, t, s stand for the ASCII character BS, LF,
  27.     CR, HT, SP.  A '\' followed by any other character stands for that 
  28.     character.
  29.  
  30. EXAMPLE
  31.     The following example creates a list of all the words in 'file1' one per 
  32.     line in 'file2', where a word is taken to be a string of alphabetics.  
  33.  
  34.           tr -cs A-Za-z \n <file1 >file2
  35.  
  36. RESTRICTIONS
  37.      Tr deletes all ASCII NUL characters from the input.  A '\000' specified 
  38.      in string1 or string2 is translated to mean '\001'.
  39.